/*
 * FoldStrategy.java
 *
 * Created on 8 de Abril de 2011, 23:01
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package intopo.game;

import java.io.PrintStream;

/**
 * An interface that represents a high order term that takes strategies and reduces them to single value.  Implementors of this interface may take a population of strategies and calculate the average strategy.
 *
 * @param S The class that represents the strategy.
 * @author pedro
 */
public interface FoldStrategy<S extends Strategy>
{
	/**
	 * Resets the <i>acumulator</i>. Subsequent calls to method {@code apply(S)} should calculate the same value.
	 */
	public void start ();

	/**
	 * Applies this high order term on the given strategy.
	 */
	public void apply (S strategy);

	/**
	 * Prints the result from reducing a set of strategies to the given stream.
	 */
	public void print (PrintStream ps);
}
